<template>
<h1>消息提示组件</h1>
  <el-button :plain="true" @click="open(1)">Success</el-button>
  <el-button :plain="true" @click="open(2)">Warning</el-button>
  <el-button :plain="true" @click="open(3)">普通</el-button>
  <el-button :plain="true" @click="open(4)">Error</el-button>
  <el-button :plain="true" @click="open(5)">可关闭</el-button>
</template>
<script setup>
import {ElMessage} from "element-plus";

const open = (i)=>{
  switch(i){
    case 1:
      ElMessage.success('成功消息');
      break;
    case 2:
      ElMessage.warning('警告消息');
      break;
    case 3:
      ElMessage('普通消息');
      break;
    case 4:
      ElMessage.error('错误消息');
      break;
    case 5:
      ElMessage.error({message:'可关闭消息',showClose:true});

  }
}
</script>


<style scoped>

</style>